import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Transaction;

/**
 * redis测试抢购
 * @author 10255_000
 *
 */
public class RedisTest {
	public static void main(String[] args){
		final String watchkeys = "watchkeys";
		Executor executor = Executors.newFixedThreadPool(20);
		
		final Jedis jedis = new Jedis("192.168.1.241", 6379);
		jedis.set(watchkeys, "0");//重置watchkeys为0
		jedis.del("setsucc","setfail");//清空抢成功的，与没有成功的
		
		jedis.close();  
		
		for(int i=0;i<1000;i++){
			executor.execute(new MyRunnable());
		}
		
	}
}
